﻿#region zh-CHS 2006 - 2010 DemoSoft 团队 | en 2006-2010 DemoSoft Team

//     NOTES
// ---------------
//
// This file is a part of the MMOSE(Massively Multiplayer Online Server Engine) for .NET.
//
//                              2006-2010 DemoSoft Team
//
//
// First Version : by H.Q.Cai - mailto:caihuanqing@hotmail.com

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

#region zh-CHS 包含名字空间 | en Include namespace

#endregion

using System;
namespace Demo.Mmose.Core.Entity.Suit.Quest
{
    /// <summary>
    /// 后检查任务的状态
    /// </summary>
    public struct QuestStatus : IComparable, IComparable<QuestStatus>
    {
        #region zh-CHS 共有常量 | en Public Constants
        /// <summary>
        /// 没有任务状态
        /// </summary>
        public const long NONE = 0;
        /// <summary>
        /// 任务没有激活状态
        /// </summary>
        public const long NOT_AVAILABLE = 1;
        /// <summary>
        /// 任务没有激活且等级太高的状态
        /// </summary>
        public const long TOO_HIGH_LEVEL = 2;
        /// <summary>
        /// 任务没有激活且等级太低的状态
        /// </summary>
        public const long TOO_LOW_LEVEL = 4;
        /// <summary>
        /// 任务没有完成状态
        /// </summary>
        public const long NOT_COMPLETED = 5;
        /// <summary>
        /// 可重复的任务已经完成的状态
        /// </summary>
        public const long REPEATEABLE_COMPLETABLE = 6;
        /// <summary>
        /// 可以重复的任务
        /// </summary>
        public const long REPEATABLE = 7;
        /// <summary>
        /// 任务激活状态
        /// </summary>
        public const long AVAILABLE = 8;
        /// <summary>
        /// 任务完成，但迷你地图不显示出来
        /// </summary>
        public const long COMPLETABLE_NO_MINIMAP = 9;
        /// <summary>
        /// 任务完成
        /// </summary>
        public const long COMPLETABLE = 10;
        #endregion

        #region zh-CHS 共有属性 | en Public Properties

        #region zh-CHS Status属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private long m_Status;
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public long Status
        {
            get { return m_Status; }
            set { m_Status = value; }
        }

        #endregion

        #endregion

        #region zh-CHS 方法 | en Method
        /// <summary>
        /// 
        /// </summary>
        /// <param name="l"></param>
        /// <param name="r"></param>
        /// <returns></returns>
        public static bool operator ==( QuestStatus QuestStatusA, QuestStatus QuestStatusB )
        {
            return QuestStatusA.m_Status == QuestStatusB.m_Status;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="l"></param>
        /// <param name="r"></param>
        /// <returns></returns>
        public static bool operator !=( QuestStatus QuestStatusA, QuestStatus QuestStatusB )
        {
            return QuestStatusA.m_Status != QuestStatusB.m_Status;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="iSerial"></param>
        /// <returns></returns>
        public static explicit operator long( QuestStatus questStatus )
        {
            return questStatus.m_Status;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="questStatusId"></param>
        /// <returns></returns>
        public static implicit operator QuestStatus( long lQuestStatus )
        {
            return new QuestStatus() { m_Status = lQuestStatus };
        }
        #endregion

        #region zh-CHS 方法覆盖 | en Method Overrides
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return String.Format( "0x{0:X8}", m_Status );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            return m_Status.GetHashCode();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="xObject"></param>
        /// <returns></returns>
        public override bool Equals( object xObject )
        {
            if ( xObject == null || !( xObject is QuestStatus ) ) return false;

            return ( (QuestStatus)xObject ).m_Status == m_Status;
        }
        #endregion

        #region zh-CHS 接口实现 | en Interface Implementation
        /// <summary>
        /// 
        /// </summary>
        /// <param name="otherComponentId"></param>
        /// <returns></returns>
        public int CompareTo( QuestStatus otherQuestStatus )
        {
            return m_Status.CompareTo( otherQuestStatus.m_Status );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="otherObject"></param>
        /// <returns></returns>
        public int CompareTo( object otherObject )
        {
            if ( otherObject == null )
                return 1;
            else if ( otherObject is QuestStatus )
                return CompareTo( (QuestStatus)otherObject );

            return -1;
        }
        #endregion
    }

    /// <summary>
    /// 先检查任务是否有效
    /// </summary>
    public struct QuestInvalidReason : IComparable, IComparable<QuestInvalidReason>
    {
        #region zh-CHS 共有常量 | en Public Constants
        /// <summary>
        /// 无
        /// </summary>
        public const long NONE = 0x00;
        /// <summary>
        /// 可以接任务没问题
        /// </summary>
        public const long OK = 0x01;
        /// <summary>
        /// 没有足够的条件接受任务
        /// </summary>
        public const long NO_REQUIREMENTS = 0x02;
        /// <summary>
        /// 等级太低不可以接任务
        /// </summary>
        public const long LOW_LEVEL = 0x03;
        /// <summary>
        /// 等级太高不可以接任务
        /// </summary>
        public const long HIGH_LEVEL = 0x04;
        /// <summary>
        /// 任务已经完成过了
        /// </summary>
        public const long ALREADY_COMPLETED = 0x05;
        /// <summary>
        /// 任务已经失败过了
        /// </summary>
        public const long ALREADY_FAILURE = 0x06;
        /// <summary>
        /// 任务已经接过了
        /// </summary>
        public const long ALREADY_HAVE = 0x07;
        /// <summary>
        /// 没有需要的道具不可以接任务
        /// </summary>
        public const long NO_REQUIRED_ITEMS = 0x08;
        /// <summary>
        /// 没有足够的金钱不可以接任务
        /// </summary>
        public const long NOT_ENOUGH_MONEY = 0x09;
        #endregion

        #region zh-CHS 共有属性 | en Public Properties

        #region zh-CHS Status属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private long m_Status;
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public long Status
        {
            get { return m_Status; }
            set { m_Status = value; }
        }

        #endregion

        #endregion

        #region zh-CHS 方法 | en Method
        /// <summary>
        /// 
        /// </summary>
        /// <param name="l"></param>
        /// <param name="r"></param>
        /// <returns></returns>
        public static bool operator ==( QuestInvalidReason QuestInvalidReasonA, QuestInvalidReason QuestInvalidReasonB )
        {
            return QuestInvalidReasonA.m_Status == QuestInvalidReasonB.m_Status;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="l"></param>
        /// <param name="r"></param>
        /// <returns></returns>
        public static bool operator !=( QuestInvalidReason QuestInvalidReasonA, QuestInvalidReason QuestInvalidReasonB )
        {
            return QuestInvalidReasonA.m_Status != QuestInvalidReasonB.m_Status;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="iSerial"></param>
        /// <returns></returns>
        public static explicit operator long( QuestInvalidReason questInvalidReason )
        {
            return questInvalidReason.m_Status;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="questStatusId"></param>
        /// <returns></returns>
        public static implicit operator QuestInvalidReason( long lQuestInvalidReason )
        {
            return new QuestInvalidReason() { m_Status = lQuestInvalidReason };
        }
        #endregion

        #region zh-CHS 方法覆盖 | en Method Overrides
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return String.Format( "0x{0:X8}", m_Status );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            return m_Status.GetHashCode();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="xObject"></param>
        /// <returns></returns>
        public override bool Equals( object xObject )
        {
            if ( xObject == null || !( xObject is QuestInvalidReason ) ) return false;

            return ( (QuestInvalidReason)xObject ).m_Status == m_Status;
        }
        #endregion

        #region zh-CHS 接口实现 | en Interface Implementation
        /// <summary>
        /// 
        /// </summary>
        /// <param name="otherComponentId"></param>
        /// <returns></returns>
        public int CompareTo( QuestInvalidReason otherQuestInvalidReason )
        {
            return m_Status.CompareTo( otherQuestInvalidReason.m_Status );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="otherObject"></param>
        /// <returns></returns>
        public int CompareTo( object otherObject )
        {
            if ( otherObject == null )
                return 1;
            else if ( otherObject is QuestStatus )
                return CompareTo( (QuestStatus)otherObject );

            return -1;
        }
        #endregion
    }
}
#endregion